﻿using DataAchive.Model.Excel.Export;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataAchive.Extend
{
    //主分类不知 且每个机台配置会有差别，
    public class AiDefectStaticsReport
    {
        //行列报表同一个组件已经去重
        public static AiDefectStaticViewModel GetReportData(List<ColRowReport> heBingReport)
        {
            AiDefectStaticViewModel aiDefectStaticViewModel = new AiDefectStaticViewModel();

         
            List<string> allfaults = new List<string>();

            aiDefectStaticViewModel.ProductCount = heBingReport.Count;
            aiDefectStaticViewModel.OKCount = heBingReport.Count(x => x.HumanJudgeTime == TimeSpan.Zero);
            aiDefectStaticViewModel.NGCount = aiDefectStaticViewModel.ProductCount - aiDefectStaticViewModel.OKCount;

            foreach (var item in heBingReport)
            {

                /*
                汇流条检
       焊带偏移,焊带过长,焊带过短,焊带缺失,焊带虚焊,   焊带弯曲 , 汇流条缺失, 汇流条偏移      ,爬电距离,焊带异常,EVA膜偏移
       焊带未焊接
       方阵偏移
                */

                if (item.ElAiDetectInfo.Contains("焊带偏移") || item.ViAiDetectInfo.Contains("焊带偏移"))
                {
                    aiDefectStaticViewModel.HanDaiPianYi++;
                  
                }
                if (item.ElAiDetectInfo.Contains("焊带过长") || item.ViAiDetectInfo.Contains("焊带过长"))
                {
                    aiDefectStaticViewModel.HanDaiGuoChang++;
                  
                }
                if (item.ElAiDetectInfo.Contains("焊带过短") || item.ViAiDetectInfo.Contains("焊带过短"))
                {
                    aiDefectStaticViewModel.HanDaiGuoDuan++;
                }
                if (item.ElAiDetectInfo.Contains("焊带缺失") || item.ViAiDetectInfo.Contains("焊带缺失"))
                {
                    aiDefectStaticViewModel.HanDaiQueShi++;
                }
                if (item.ElAiDetectInfo.Contains("焊带虚焊") || item.ViAiDetectInfo.Contains("焊带虚焊"))
                {
                    aiDefectStaticViewModel.HanDaiXuHan++;
                }
                if (item.ElAiDetectInfo.Contains("焊带弯曲") || item.ViAiDetectInfo.Contains("焊带弯曲"))
                {
                    aiDefectStaticViewModel.HanDaiWanQu++;
                }
                if (item.ElAiDetectInfo.Contains("汇流条缺失") || item.ViAiDetectInfo.Contains("汇流条缺失"))
                {
                    aiDefectStaticViewModel.HuiLiuTiaoQueShi++;
                }
                if (item.ElAiDetectInfo.Contains("汇流条偏移") || item.ViAiDetectInfo.Contains("汇流条偏移"))
                {
                    aiDefectStaticViewModel.HuiLiuTiaoPianYi++;
                }
                if (item.ElAiDetectInfo.Contains("爬电距离") || item.ViAiDetectInfo.Contains("爬电距离"))
                {
                    aiDefectStaticViewModel.PaDianJuLi++;
                }
                if (item.ElAiDetectInfo.Contains("焊带异常") || item.ViAiDetectInfo.Contains("焊带异常"))
                {
                    aiDefectStaticViewModel.HanDaiYiChang++;
                }
                if (item.ElAiDetectInfo.Contains("EVA膜偏移") || item.ViAiDetectInfo.Contains("EVA膜偏移"))
                {
                    aiDefectStaticViewModel.EVAMoPianYi++;
                }
                if (item.ElAiDetectInfo.Contains("焊带未焊接") || item.ViAiDetectInfo.Contains("焊带未焊接"))
                {
                    aiDefectStaticViewModel.HanDaiWeiHanJie++;
                }
                if (item.ElAiDetectInfo.Contains("方阵偏移") || item.ViAiDetectInfo.Contains("方阵偏移"))
                {
                    aiDefectStaticViewModel.FangZhenPianYi++;
                }

                /*
     叠焊背面检
                片间距
                串间距
                缺角
                破片
                焊带偏移
                玻璃异物
                异物
                 */

                if (item.ElAiDetectInfo.Contains("片间距") || item.ViAiDetectInfo.Contains("片间距"))
                {
                    aiDefectStaticViewModel.PianJianJu++;
                }
                if (item.ElAiDetectInfo.Contains("串间距") || item.ViAiDetectInfo.Contains("串间距"))
                {
                    aiDefectStaticViewModel.ChuanJianJu++;
                }
                if (item.ElAiDetectInfo.Contains("缺角") || item.ViAiDetectInfo.Contains("缺角"))
                {
                    aiDefectStaticViewModel.QueJiao++;
                }
                if (item.ElAiDetectInfo.Contains("破片") || item.ViAiDetectInfo.Contains("破片"))
                {
                    aiDefectStaticViewModel.PoPian++;
                }
                
                if (item.ElAiDetectInfo.Contains("玻璃异物") || item.ViAiDetectInfo.Contains("玻璃异物"))
                {
                    aiDefectStaticViewModel.BoLiYiWu ++;
                }
                if (item.ElAiDetectInfo.Contains("异物") || item.ViAiDetectInfo.Contains("异物"))
                {
                    aiDefectStaticViewModel.YiWu++;
                }

                /*
                 翻转检
硅胶脏污,POE残留,气泡,爆板,焊带偏移,电池片划伤
电池片破片
电池片异物
电池片脏污 
条形码歪斜
条形码缺失
边缘玻璃异物
条码信息
膜偏移
电池片翘曲
连续气泡
鱼眼气泡
中孔气泡
                 */
                if (item.ElAiDetectInfo.Contains("硅胶脏污") || item.ViAiDetectInfo.Contains("硅胶脏污"))
                {
                    aiDefectStaticViewModel.GuiJiaoZangWu++;
                }
                if (item.ElAiDetectInfo.Contains("POE残留") || item.ViAiDetectInfo.Contains("POE残留"))
                {
                    aiDefectStaticViewModel.POECanLiu++;
                }
                if (item.ElAiDetectInfo.Contains("气泡") || item.ViAiDetectInfo.Contains("1111"))
                {
                    aiDefectStaticViewModel.QiPao++;
                }
                if (item.ElAiDetectInfo.Contains("爆板") || item.ViAiDetectInfo.Contains("爆板"))
                {
                    aiDefectStaticViewModel.BaoBan++;
                }
                if (item.ElAiDetectInfo.Contains("电池片划伤") || item.ViAiDetectInfo.Contains("电池片划伤"))
                {
                    aiDefectStaticViewModel.DianChiPianHuaShang++;
                }
                if (item.ElAiDetectInfo.Contains("电池片破片") || item.ViAiDetectInfo.Contains("电池片破片"))
                {
                    aiDefectStaticViewModel.DianChiPianPoPian++;
                }
                if (item.ElAiDetectInfo.Contains("电池片异物") || item.ViAiDetectInfo.Contains("电池片异物"))
                {
                    aiDefectStaticViewModel.DianChiPianYiWu++;
                }
                if (item.ElAiDetectInfo.Contains("电池片脏污") || item.ViAiDetectInfo.Contains("电池片脏污"))
                {
                    aiDefectStaticViewModel.DianChiPianZangWu++;
                }
                if (item.ElAiDetectInfo.Contains("条形码歪斜") || item.ViAiDetectInfo.Contains("条形码歪斜"))
                {
                    aiDefectStaticViewModel.TiaoXingMaWaiXie++;
                }
                if (item.ElAiDetectInfo.Contains("条形码缺失") || item.ViAiDetectInfo.Contains("条形码缺失"))
                {
                    aiDefectStaticViewModel.TiaoXingMaQueShi++;
                }
                if (item.ElAiDetectInfo.Contains("边缘玻璃异物") || item.ViAiDetectInfo.Contains("边缘玻璃异物"))
                {
                    aiDefectStaticViewModel.BianYuanBoLiYiWu++;
                }
                if (item.ElAiDetectInfo.Contains("条码信息") || item.ViAiDetectInfo.Contains("条码信息"))
                {
                    aiDefectStaticViewModel.TiaoMaXinXi++;
                }
                if (item.ElAiDetectInfo.Contains("膜偏移") || item.ViAiDetectInfo.Contains("膜偏移"))
                {
                    aiDefectStaticViewModel.MoPianYi++;
                }
                if (item.ElAiDetectInfo.Contains("电池片翘曲") || item.ViAiDetectInfo.Contains("电池片翘曲"))
                {
                    aiDefectStaticViewModel.DianChiPianQiaoQu++;
                }
                if (item.ElAiDetectInfo.Contains("连续气泡") || item.ViAiDetectInfo.Contains("连续气泡"))
                {
                    aiDefectStaticViewModel.LianXuQiPao++;
                }
                if (item.ElAiDetectInfo.Contains("鱼眼气泡") || item.ViAiDetectInfo.Contains("鱼眼气泡"))
                {
                    aiDefectStaticViewModel.YuYanQiPao++;
                }
                if (item.ElAiDetectInfo.Contains("中孔气泡") || item.ViAiDetectInfo.Contains("中孔气泡"))
                {
                    aiDefectStaticViewModel.ZhongKongQiPao++;
                }


                /*
                 灌胶检
溢胶
缺胶
引出线外漏
滴胶

                 */
                if (item.ElAiDetectInfo.Contains("溢胶") || item.ViAiDetectInfo.Contains("溢胶"))
                {
                    aiDefectStaticViewModel.YiJiao++;
                }
           
                if (item.ElAiDetectInfo.Contains("引出线外漏") || item.ViAiDetectInfo.Contains("引出线外漏"))
                {
                    aiDefectStaticViewModel.YinChuXianWaiLou++;
                }
                if (item.ElAiDetectInfo.Contains("滴胶") || item.ViAiDetectInfo.Contains("滴胶"))
                {
                    aiDefectStaticViewModel.DiJiao++;
                }

                /*
                 角缝检
角缝异常
脏污
溢胶
划伤
其它
                 */
                if (item.ElAiDetectInfo.Contains("角缝异常") || item.ViAiDetectInfo.Contains("角缝异常"))
                {
                    aiDefectStaticViewModel.JiaoFengYiChang++;
                }
                if (item.ElAiDetectInfo.Contains("脏污") || item.ViAiDetectInfo.Contains("脏污"))
                {
                    aiDefectStaticViewModel.ZangWu++;
                }
                if (item.ElAiDetectInfo.Contains("划伤") || item.ViAiDetectInfo.Contains("划伤"))
                {
                    aiDefectStaticViewModel.HuaShang++;
                }
                if (item.ElAiDetectInfo.Contains("其它") || item.ViAiDetectInfo.Contains("其它"))
                {
                    aiDefectStaticViewModel.QiTa++;
                }

                /*
                 边框胶线检
脏污
划伤
缺胶
卷边
断胶
气泡
胶线异物

                 */
                if (item.ElAiDetectInfo.Contains("卷边") || item.ViAiDetectInfo.Contains("卷边"))
                {
                    aiDefectStaticViewModel.JuanBian++;
                }
                if (item.ElAiDetectInfo.Contains("断胶") || item.ViAiDetectInfo.Contains("断胶"))
                {
                    aiDefectStaticViewModel.DuanJiao++;
                }
                if (item.ElAiDetectInfo.Contains("胶线异物") || item.ViAiDetectInfo.Contains("胶线异物"))
                {
                    aiDefectStaticViewModel.JiaoXianYiWu++;
                }

                /*
                 装框正面检
片间距
串间距
崩边
缺角
破片
脏污
划伤
爆件

                 */
                if (item.ElAiDetectInfo.Contains("崩边") || item.ViAiDetectInfo.Contains("崩边"))
                {
                    aiDefectStaticViewModel.BengBian++;
                }
                if (item.ElAiDetectInfo.Contains("爆件") || item.ViAiDetectInfo.Contains("爆件"))
                {
                    aiDefectStaticViewModel.BaoJian++;
                }


                /*
                 铭牌检
铭牌缺失
铭牌歪斜
铭牌气泡
铭牌褶皱
整体偏移
参数偏移
多铭牌
参数缺失

                 */
                if (item.ElAiDetectInfo.Contains("铭牌缺失") || item.ViAiDetectInfo.Contains("铭牌缺失"))
                {
                    aiDefectStaticViewModel.MingPaiQueShi++;
                }
                if (item.ElAiDetectInfo.Contains("铭牌歪斜") || item.ViAiDetectInfo.Contains("铭牌歪斜"))
                {
                    aiDefectStaticViewModel.MingPaiWaiXie++;
                }
                if (item.ElAiDetectInfo.Contains("铭牌气泡") || item.ViAiDetectInfo.Contains("铭牌气泡"))
                {
                    aiDefectStaticViewModel.MingPaiQiPao++;
                }
                if (item.ElAiDetectInfo.Contains("铭牌褶皱") || item.ViAiDetectInfo.Contains("铭牌褶皱"))
                {
                    aiDefectStaticViewModel.MingPaiZhouZhe++;
                }
                if (item.ElAiDetectInfo.Contains("整体偏移") || item.ViAiDetectInfo.Contains("整体偏移"))
                {
                    aiDefectStaticViewModel.ZhengTiPianYi++;
                }
                if (item.ElAiDetectInfo.Contains("参数偏移") || item.ViAiDetectInfo.Contains("参数偏移"))
                {
                    aiDefectStaticViewModel.CanShuPianYi++;
                }
                if (item.ElAiDetectInfo.Contains("多铭牌") || item.ViAiDetectInfo.Contains("多铭牌"))
                {
                    aiDefectStaticViewModel.DuoMingPai++;
                }
                if (item.ElAiDetectInfo.Contains("参数缺失") || item.ViAiDetectInfo.Contains("参数缺失"))
                {
                    aiDefectStaticViewModel.CanShuQueShi++;
                }

                /*
                 终检线扫
接线盒未盖
气泡
硅胶脏污
POE残留
漏工装
滴胶
溢胶

                 */
                if (item.ElAiDetectInfo.Contains("接线盒未盖") || item.ViAiDetectInfo.Contains("接线盒未盖"))
                {
                    aiDefectStaticViewModel.JieXianHeWeiGai++;
                }
                if (item.ElAiDetectInfo.Contains("漏工装") || item.ViAiDetectInfo.Contains("漏工装"))
                {
                    aiDefectStaticViewModel.LouGongZhuang++;
                }
  

            }

            //第二步，误检数据=>过判的el和ai的检测数据
            var loujianWupan = heBingReport.Where(x => x.Equals("过判"));
            foreach (var itemTwo in loujianWupan) 
            {
                /*
      汇流条检
焊带偏移,焊带过长,焊带过短,焊带缺失,焊带虚焊,   焊带弯曲 , 汇流条缺失, 汇流条偏移      ,爬电距离,焊带异常,EVA膜偏移
焊带未焊接
方阵偏移
      */

                if (itemTwo.ElAiDetectInfo.Contains("焊带偏移") || itemTwo.ViAiDetectInfo.Contains("焊带偏移"))
                {
                    aiDefectStaticViewModel.HanDaiPianYi_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("焊带过长") || itemTwo.ViAiDetectInfo.Contains("焊带过长"))
                {
                    aiDefectStaticViewModel.HanDaiGuoChang_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("焊带过短") || itemTwo.ViAiDetectInfo.Contains("焊带过短"))
                {
                    aiDefectStaticViewModel.HanDaiGuoDuan_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("焊带缺失") || itemTwo.ViAiDetectInfo.Contains("焊带缺失"))
                {
                    aiDefectStaticViewModel.HanDaiQueShi_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("焊带虚焊") || itemTwo.ViAiDetectInfo.Contains("焊带虚焊"))
                {
                    aiDefectStaticViewModel.HanDaiXuHan_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("焊带弯曲") || itemTwo.ViAiDetectInfo.Contains("焊带弯曲"))
                {
                    aiDefectStaticViewModel.HanDaiWanQu_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("汇流条缺失") || itemTwo.ViAiDetectInfo.Contains("汇流条缺失"))
                {
                    aiDefectStaticViewModel.HuiLiuTiaoQueShi_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("汇流条偏移") || itemTwo.ViAiDetectInfo.Contains("汇流条偏移"))
                {
                    aiDefectStaticViewModel.HuiLiuTiaoPianYi_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("爬电距离") || itemTwo.ViAiDetectInfo.Contains("爬电距离"))
                {
                    aiDefectStaticViewModel.PaDianJuLi_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("焊带异常") || itemTwo.ViAiDetectInfo.Contains("焊带异常"))
                {
                    aiDefectStaticViewModel.HanDaiYiChang_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("EVA膜偏移") || itemTwo.ViAiDetectInfo.Contains("EVA膜偏移"))
                {
                    aiDefectStaticViewModel.EVAMoPianYi_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("焊带未焊接") || itemTwo.ViAiDetectInfo.Contains("焊带未焊接"))
                {
                    aiDefectStaticViewModel.HanDaiWeiHanJie_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("方阵偏移") || itemTwo.ViAiDetectInfo.Contains("方阵偏移"))
                {
                    aiDefectStaticViewModel.FangZhenPianYi_1++;
                }

                /*
     叠焊背面检
                片间距
                串间距
                缺角
                破片
                焊带偏移
                玻璃异物
                异物
                 */

                if (itemTwo.ElAiDetectInfo.Contains("片间距") || itemTwo.ViAiDetectInfo.Contains("片间距"))
                {
                    aiDefectStaticViewModel.PianJianJu_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("串间距") || itemTwo.ViAiDetectInfo.Contains("串间距"))
                {
                    aiDefectStaticViewModel.ChuanJianJu_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("缺角") || itemTwo.ViAiDetectInfo.Contains("缺角"))
                {
                    aiDefectStaticViewModel.QueJiao_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("破片") || itemTwo.ViAiDetectInfo.Contains("破片"))
                {
                    aiDefectStaticViewModel.PoPian_1++;
                }

                if (itemTwo.ElAiDetectInfo.Contains("玻璃异物") || itemTwo.ViAiDetectInfo.Contains("玻璃异物"))
                {
                    aiDefectStaticViewModel.BoLiYiWu_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("异物") || itemTwo.ViAiDetectInfo.Contains("异物"))
                {
                    aiDefectStaticViewModel.YiWu_1++;
                }

                /*
                 翻转检
硅胶脏污,POE残留,气泡,爆板,焊带偏移,电池片划伤
电池片破片
电池片异物
电池片脏污 
条形码歪斜
条形码缺失
边缘玻璃异物
条码信息
膜偏移
电池片翘曲
连续气泡
鱼眼气泡
中孔气泡
                 */
                if (itemTwo.ElAiDetectInfo.Contains("硅胶脏污") || itemTwo.ViAiDetectInfo.Contains("硅胶脏污"))
                {
                    aiDefectStaticViewModel.GuiJiaoZangWu_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("POE残留") || itemTwo.ViAiDetectInfo.Contains("POE残留"))
                {
                    aiDefectStaticViewModel.POECanLiu_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("气泡") || itemTwo.ViAiDetectInfo.Contains("1111"))
                {
                    aiDefectStaticViewModel.QiPao_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("爆板") || itemTwo.ViAiDetectInfo.Contains("爆板"))
                {
                    aiDefectStaticViewModel.BaoBan_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("电池片划伤") || itemTwo.ViAiDetectInfo.Contains("电池片划伤"))
                {
                    aiDefectStaticViewModel.DianChiPianHuaShang_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("电池片破片") || itemTwo.ViAiDetectInfo.Contains("电池片破片"))
                {
                    aiDefectStaticViewModel.DianChiPianPoPian_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("电池片异物") || itemTwo.ViAiDetectInfo.Contains("电池片异物"))
                {
                    aiDefectStaticViewModel.DianChiPianYiWu_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("电池片脏污") || itemTwo.ViAiDetectInfo.Contains("电池片脏污"))
                {
                    aiDefectStaticViewModel.DianChiPianZangWu_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("条形码歪斜") || itemTwo.ViAiDetectInfo.Contains("条形码歪斜"))
                {
                    aiDefectStaticViewModel.TiaoXingMaWaiXie_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("条形码缺失") || itemTwo.ViAiDetectInfo.Contains("条形码缺失"))
                {
                    aiDefectStaticViewModel.TiaoXingMaQueShi_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("边缘玻璃异物") || itemTwo.ViAiDetectInfo.Contains("边缘玻璃异物"))
                {
                    aiDefectStaticViewModel.BianYuanBoLiYiWu_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("条码信息") || itemTwo.ViAiDetectInfo.Contains("条码信息"))
                {
                    aiDefectStaticViewModel.TiaoMaXinXi_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("膜偏移") || itemTwo.ViAiDetectInfo.Contains("膜偏移"))
                {
                    aiDefectStaticViewModel.MoPianYi_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("电池片翘曲") || itemTwo.ViAiDetectInfo.Contains("电池片翘曲"))
                {
                    aiDefectStaticViewModel.DianChiPianQiaoQu_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("连续气泡") || itemTwo.ViAiDetectInfo.Contains("连续气泡"))
                {
                    aiDefectStaticViewModel.LianXuQiPao_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("鱼眼气泡") || itemTwo.ViAiDetectInfo.Contains("鱼眼气泡"))
                {
                    aiDefectStaticViewModel.YuYanQiPao_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("中孔气泡") || itemTwo.ViAiDetectInfo.Contains("中孔气泡"))
                {
                    aiDefectStaticViewModel.ZhongKongQiPao_1++;
                }


                /*
                 灌胶检
溢胶
缺胶
引出线外漏
滴胶

                 */
                if (itemTwo.ElAiDetectInfo.Contains("溢胶") || itemTwo.ViAiDetectInfo.Contains("溢胶"))
                {
                    aiDefectStaticViewModel.YiJiao_1++;
                }

                if (itemTwo.ElAiDetectInfo.Contains("引出线外漏") || itemTwo.ViAiDetectInfo.Contains("引出线外漏"))
                {
                    aiDefectStaticViewModel.YinChuXianWaiLou_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("滴胶") || itemTwo.ViAiDetectInfo.Contains("滴胶"))
                {
                    aiDefectStaticViewModel.DiJiao_1++;
                }

                /*
                 角缝检
角缝异常
脏污
溢胶
划伤
其它
                 */
                if (itemTwo.ElAiDetectInfo.Contains("角缝异常") || itemTwo.ViAiDetectInfo.Contains("角缝异常"))
                {
                    aiDefectStaticViewModel.JiaoFengYiChang_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("脏污") || itemTwo.ViAiDetectInfo.Contains("脏污"))
                {
                    aiDefectStaticViewModel.ZangWu_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("划伤") || itemTwo.ViAiDetectInfo.Contains("划伤"))
                {
                    aiDefectStaticViewModel.HuaShang_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("其它") || itemTwo.ViAiDetectInfo.Contains("其它"))
                {
                    aiDefectStaticViewModel.QiTa_1++;
                }

                /*
                 边框胶线检
脏污
划伤
缺胶
卷边
断胶
气泡
胶线异物

                 */
                if (itemTwo.ElAiDetectInfo.Contains("卷边") || itemTwo.ViAiDetectInfo.Contains("卷边"))
                {
                    aiDefectStaticViewModel.JuanBian_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("断胶") || itemTwo.ViAiDetectInfo.Contains("断胶"))
                {
                    aiDefectStaticViewModel.DuanJiao_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("胶线异物") || itemTwo.ViAiDetectInfo.Contains("胶线异物"))
                {
                    aiDefectStaticViewModel.JiaoXianYiWu_1++;
                }

                /*
                 装框正面检
片间距
串间距
崩边
缺角
破片
脏污
划伤
爆件

                 */
                if (itemTwo.ElAiDetectInfo.Contains("崩边") || itemTwo.ViAiDetectInfo.Contains("崩边"))
                {
                    aiDefectStaticViewModel.BengBian_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("爆件") || itemTwo.ViAiDetectInfo.Contains("爆件"))
                {
                    aiDefectStaticViewModel.BaoJian_1++;
                }


                /*
                 铭牌检
铭牌缺失
铭牌歪斜
铭牌气泡
铭牌褶皱
整体偏移
参数偏移
多铭牌
参数缺失

                 */
                if (itemTwo.ElAiDetectInfo.Contains("铭牌缺失") || itemTwo.ViAiDetectInfo.Contains("铭牌缺失"))
                {
                    aiDefectStaticViewModel.MingPaiQueShi_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("铭牌歪斜") || itemTwo.ViAiDetectInfo.Contains("铭牌歪斜"))
                {
                    aiDefectStaticViewModel.MingPaiWaiXie_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("铭牌气泡") || itemTwo.ViAiDetectInfo.Contains("铭牌气泡"))
                {
                    aiDefectStaticViewModel.MingPaiQiPao_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("铭牌褶皱") || itemTwo.ViAiDetectInfo.Contains("铭牌褶皱"))
                {
                    aiDefectStaticViewModel.MingPaiZhouZhe_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("整体偏移") || itemTwo.ViAiDetectInfo.Contains("整体偏移"))
                {
                    aiDefectStaticViewModel.ZhengTiPianYi_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("参数偏移") || itemTwo.ViAiDetectInfo.Contains("参数偏移"))
                {
                    aiDefectStaticViewModel.CanShuPianYi_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("多铭牌") || itemTwo.ViAiDetectInfo.Contains("多铭牌"))
                {
                    aiDefectStaticViewModel.DuoMingPai_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("参数缺失") || itemTwo.ViAiDetectInfo.Contains("参数缺失"))
                {
                    aiDefectStaticViewModel.CanShuQueShi_1++;
                }

                /*
                 终检线扫
接线盒未盖
气泡
硅胶脏污
POE残留
漏工装
滴胶
溢胶

                 */
                if (itemTwo.ElAiDetectInfo.Contains("接线盒未盖") || itemTwo.ViAiDetectInfo.Contains("接线盒未盖"))
                {
                    aiDefectStaticViewModel.JieXianHeWeiGai_1++;
                }
                if (itemTwo.ElAiDetectInfo.Contains("漏工装") || itemTwo.ViAiDetectInfo.Contains("漏工装"))
                {
                    aiDefectStaticViewModel.LouGongZhuang_1++;
                }
            }
            
            return aiDefectStaticViewModel;
        }
    }
}
